package fractal;

/**
 * Created by IntelliJ IDEA.
 * User: ilya
 * Date: 24.09.11
 * Time: 18:24
 */
public class CircleFractal implements Fractal {
    public int isIn(double x, double y) {
        double d = x*x + y*y;
        if (d > 1)
            return 0;
        //Math.sqrt(1 - d). 0 -> 255, 1 -> 0
        return (int)Math.round(255 * (1 - Math.sqrt(1-d)));
    }
}
